﻿using System;

namespace Observer
{
    class RandomNumberGenerator : NumberGenerator
    {
        private Random random;
        private int number;

        public RandomNumberGenerator()
        {
            this.random = new Random();
        }


        public override int GetNumber()
        {
            return number;
        }

        public override void Execute()
        {
            for (int i = 0; i < 20; i++)
            {
                number = random.Next(50);
                NotifyObservers();
            }
        }
    }
}
